home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / editor / auror300.zip / FLOPEN.AML < prev    next >
Text File  |  1996-07-17  |  2KB  |  58 lines

  1. //--------------------------------------------------------------------
  2. // FLOPEN.AML
  3. // Open File List, (C) 1993-1996 by nuText Systems
  4. //
  5. // This macro opens a file containing a list of filenames/filespecs
  6. // and displays them in qualified format in a file manager window.
  7. //
  8. // If the file is not passed as arg 3, then the user is prompted to
  9. // enter the filename of the file list. If option 'r' is passed to this
  10. // macro as arg 4, then the new file list will replace the contents of
  11. // the current file manager window (if any).
  12. //
  13. // Usage:
  14. //
  15. // This macro can be run by selecting Open List or Replace List from
  16. // the file manager File menu, or Open File List from the file manager
  17. // Command menu.
  18. //--------------------------------------------------------------------
  19.  
  20. // compile time macros and function definitions
  21. include bootpath "define.aml"
  22.  
  23. file = arg 3
  24. options = arg 4
  25.  
  26. // get file list file
  27. if not file then
  28.   file = ask (if? (pos 'r' options) "Replace " + (onname (getbufname) + " with") "Open file list")
  29.              _load
  30.  
  31.   if not file then
  32.     return
  33.   end
  34. end
  35.  
  36. // use .Lst extension if none is specified
  37. file = defext file "lst"
  38.  
  39. // load file list
  40. file = qualify file [1..posnot '*' file 'r'] (getbufname)
  41. buffer = loadbuf file
  42. if buffer then
  43.   // directory was loaded
  44.   if getloadinfo 't' then
  45.     destroybuf
  46.     queue "msgbox" "Invalid file list!\nFile must contain a list of filenames/filespecs."
  47.   // file was loaded
  48.   else
  49.     title = getbufname
  50.     setbufname title + (if? not (poschar '*?' title) '*' '')
  51.     say "Loading " + title + "..."
  52.     fmgr.fupdate '' _FmgrOpt + _NameStyle + 'vq'
  53.     openbuf buffer (arg 4)
  54.   end
  55. else
  56.   queue "msgbox" file + " not found"
  57. end
  58.